#ifndef __INFO_H__
#define __INFO_H__

#include <stdbool.h>

extern bool err;

extern const char* lexErrMsg[];
extern const char* synErrMsg[];
extern const char* semErrMsg[];
extern const char* tsErrMsg[];

static const int DebugOn = 1;

#define DEBUG(fmt, ...)                                                        \
    do {                                                                       \
        if (DebugOn) {                                                         \
            printf("[DEBUG] %s:%d <%s>: ", __FILE__, __LINE__, __FUNCTION__); \
            printf(fmt, ##__VA_ARGS__);                                        \
        }                                                                      \
    } while (0)

enum lexErr
{
    INV_ID,
    INV_CHAR
};

enum synErr
{
    SYN_ERR,
    INV_ST,
    INV_DEF,
    MS_SEMI,
    MS_CM,
    MS_LP,
    MS_RP,
    MS_LB,
    MS_RB,
    MS_LC,
    MS_RC
};


enum semErr{
    empty,
    UN_VAR,
    UN_FUNC,
    RE_VAR,
    RE_FUNC,
    AS_TYPE,
    AS_RVAL,
    OP_TYPE,
    RET_TYPE,
    INC_ARG,
    NOT_ARR,
    NOT_FUNC,
    NOT_INT,
    NOT_STRUCT,
    NON_FIELD,
    RE_FIELD,
    RE_STRUCT,
    UN_STRUCT
};

enum tsErr { HAS_STRUCTURE, HAS_FLOAT, POINTER_ASSIGNMENT };

#endif